/*
 * RouteNodeStation.java
 *
 * Created on March 3, 2007, 5:57 PM
 *
 * Copyright 2008 David D. Emory
 * 
 * This file is part of Five Points. See <http://www.fpdev.org> for
 * additional information regarding the project.
 * 
 * Five Points is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Five Points is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Five Points. If not, see <http://www.gnu.org/licenses/>.
 */
package org.fpdev.core.routenet;

import org.fpdev.core.transit.Station;
import org.fpdev.core.transit.*;
import java.util.Iterator;
import org.fpdev.core.basenet.BNode;

/**
 *
 * @author demory
 */
public class RNodeStation extends RNode {

  private Station station_;

  /** Creates a new instance of CRouteNodeStation */
  public RNodeStation(Station station) {
    super("s_" + station.getID());
    station_ = station;
  }

  public double getX() {
    double total = 0, count = 0;
    for(BNode node : station_.getNodes()) {
      total += node.getX();
      count += 1;
    }
    return total / count;
  }

  public double getY() {
    double total = 0, count = 0;
    for(BNode node : station_.getNodes()) {
      total += node.getY();
      count += 1;
    }
    return total / count;
  }
}
